<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>商品列表 - SXT商城</title>
		<%@ include file="/common/include/title.jsp"%>
		<link type="text/css" href="${rootpath }/css/my.css" rel="stylesheet">
		<link type="text/css" href="${rootpath }/css/list.css" rel="stylesheet">
		<script type="text/javascript">
			var timeout = 500;
			var closetimer = 0;
			var ddmenuitem = 0;
		
			$(document).ready(function() {
				$('.cat_item').mousemove(function() {
					$(this).addClass('cat_item_on');
				});
				$('.cat_item').mouseleave(function() {
					$(this).removeClass('cat_item_on');
				});
				$('#slideshow').imgSlideShow({
					itemclass : 'i'
				})
				$("#slide-qg").switchTab({
					titCell : "dt a",
					trigger : "mouseover",
					delayTime : 0
				});
				$("#s_cart_nums1").hover(function() {
					mcancelclosetime();
					if (ddmenuitem)
						ddmenuitem.hide();
					ddmenuitem = $(document).find("#s_cartbox");
					ddmenuitem.fadeIn();
				}, function() {
					mclosetime();
				});
				$("#s_cart_nums2").hover(function() {
					mcancelclosetime();
					if (ddmenuitem)
						ddmenuitem.hide();
					ddmenuitem = $(document).find("#s_cartbox");
					ddmenuitem.fadeIn();
				}, function() {
					mclosetime();
				});
				$("#s_cartbox").hover(function() {
					mcancelclosetime();
				}, function() {
					mclosetime();
				});
				var $cur = 1;
				var $i = 4;
				var $len = $('.hot_list>ul>li').length;
				var $pages = Math.ceil($len / $i);
				var $w = $('.hotp').width() - 66;
		
				var $showbox = $('.hot_list');
		
				var $pre = $('div.left_icon');
				var $next = $('div.rgt_icon');
		
				$pre.click(function() {
					if (!$showbox.is(':animated')) {
						if ($cur == 1) {
							$showbox.animate({
								left : '-=' + $w * ($pages - 1)
							}, 500);
							$cur = $pages;
						} else {
							$showbox.animate({
								left : '+=' + $w
							}, 500);
							$cur--;
						}
		
					}
				});
		
				$next.click(function() {
					if (!$showbox.is(':animated')) {
						if ($cur == $pages) {
							$showbox.animate({
								left : 0
							}, 500);
							$cur = 1;
						} else {
							$showbox.animate({
								left : '-=' + $w
							}, 500);
							$cur++;
						}
		
					}
				});
		
			});
			function mclose() {
				if (ddmenuitem)
					ddmenuitem.hide();
			}
			function mclosetime() {
				closetimer = window.setTimeout(mclose, timeout);
			}
			function mcancelclosetime() {
				if (closetimer) {
					window.clearTimeout(closetimer);
					closetimer = null;
				}
			}
		</script>
	</head>
	<body>
		<div id="doc">
			<%@ include file="/common/include/header.jsp"%>
			<div id="s_bdw">
				<div id="s_bd">
					<div class="zadv">
						<a href="#"><img src="images/3215wa.jpg" alt="" height="62"
							width="980"></a>
					</div>
				
					<div class="breadcrumbs">
						<div class="f-l">
							<a href="#">全部结果</a><span>»</span><a href="#">食品、饮料、酒水</a><span>»</span><a
								href="#">进口食品</a><span>»</span>进口米
						</div>
						<div class="f-r">
							搜索结果(<b class="red">19</b>)
						</div>
					</div>
				
					<div class="f-l leftlist">
						<div class="sort">
							<h2>筛选分类</h2>
							<h3>
								<a href="#">大家电、生活电器(3890)</a>
							</h3>
							<dl>
								<dt>
									<a href="#">厨房电器(1001)</a>
								</dt>
								<dd>
									<span>豆浆机(85)</span> <a href="#">微波炉(35)</a> <a href="#">电压力锅(181)</a>
									<a href="#">电水壶/热水瓶(144)</a> <a href="#">电磁炉(53)</a> <a href="#">多用途锅(78)</a>
									<a href="#">电饼铛/煎拷机(3)</a> <a href="#">煮蛋器(34)</a>
								</dd>
							</dl>
							<h3>
								<a href="#">大家电、生活电器(3890)</a>
							</h3>
							<dl>
								<dt>
									<span>厨房电器(1001)</span>
								</dt>
								<dd>
									<a href="#">豆浆机(85)</a> <a href="#">微波炉(35)</a> <a href="#">电压力锅(181)</a>
									<a href="#">电水壶/热水瓶(144)</a> <a href="#">电磁炉(53)</a> <a href="#">多用途锅(78)</a>
									<a href="#">电饼铛/煎拷机(3)</a> <a href="#">煮蛋器(34)</a>
								</dd>
							</dl>
						</div>
						<!--sort end-->
				
						<div class="ladv">
							<a href="#"><img src="images/2asd.jpg" alt="" height="72"
								width="205"></a>
						</div>
				
						<div class="ladv">
							<a href="#"><img src="images/12ad.jpg" alt="" height="72"
								width="205"></a>
						</div>
				
						<div class="ladv">
							<a href="#"><img src="images/21af.jpg" alt="" height="72"
								width="205"></a>
						</div>
				
						<div class="Toplist">
							<div class="Ttitle">
								<h2 class="f-l">热销商品排行榜</h2>
							</div>
							<div class="Topcon">
								<ul>
									<li><a href="#"><img src="images/124ad.jpg" alt=""
											height="58" width="58"></a>
										<p>
											<a href="#">心相印优选装200抽2层塑装面巾纸</a><br>
											<strong class="red">￥10.9</strong>
										</p></li>
									<li><a href="#"><img src="images/124ad.jpg" alt=""
											height="58" width="58"></a>
										<p>
											<a href="#">心相印优选装200抽2层塑装面巾纸</a><br>
											<strong class="red">￥10.9</strong>
										</p></li>
									<li><a href="#"><img src="images/124ad.jpg" alt=""
											height="58" width="58"></a>
										<p>
											<a href="#">心相印优选装200抽2层塑装面巾纸</a><br>
											<strong class="red">￥10.9</strong>
										</p></li>
									<li><a href="#"><img src="images/124ad.jpg" alt=""
											height="58" width="58"></a>
										<p>
											<a href="#">心相印优选装200抽2层塑装面巾纸</a><br>
											<strong class="red">￥10.9</strong>
										</p></li>
									<li class="last"><a href="#"><img src="images/124ad.jpg"
											alt="" height="58" width="58"></a>
										<p>
											<a href="#">心相印优选装200抽2层塑装面巾纸</a><br>
											<strong class="red">￥10.9</strong>
										</p></li>
								</ul>
							</div>
						</div>
						<!--Toplist end-->
				
						<div class="Toplist">
							<div class="Ttitle">
								<h2 class="f-l">浏览记录</h2>
								<a style="color: #4484db;" class="f-r" href="#"><b>清除</b></a>
							</div>
							<div class="browselist">
								<ul class="cf">
									<li><a href="#"><img src="images/21da.jpg" alt=""
											height="58" width="58"></a></li>
									<li><a href="#"><img src="images/21da.jpg" alt=""
											height="58" width="58"></a></li>
									<li><a href="#"><img src="images/21da.jpg" alt=""
											height="58" width="58"></a></li>
									<li><a href="#"><img src="images/21da.jpg" alt=""
											height="58" width="58"></a></li>
									<li><a href="#"><img src="images/21da.jpg" alt=""
											height="58" width="58"></a></li>
									<li><a href="#"><img src="images/21da.jpg" alt=""
											height="58" width="58"></a></li>
								</ul>
							</div>
						</div>
						<!--Toplist end-->
				
					</div>
					<!--leftlist end-->
				
					<div class="f-r rightlist">
				
						<div class="hotbox cf">
							<div class="f-l hotcon">
								<h2>热卖推荐</h2>
								<ul class="cf">
									<li><a href="#"><img src="images/21ad.jpg" alt=""
											height="115" width="115"></a>
										<dl>
											<dt>
												<a href="#">凌仕魅动男士香氛-契合</a>
											</dt>
											<dd>
												特价：<strong class="red">￥52.9</strong>
											</dd>
											<dd>
												<span class="startotal"></span>
											</dd>
											<dd>
												<a class="addcat" href="#">加入购物车</a>
											</dd>
										</dl></li>
									<li><a href="#"><img src="images/214ad.jpg" alt=""
											height="115" width="115"></a>
										<dl>
											<dt>
												<a href="#">凌仕魅动男士香氛-契合</a>
											</dt>
											<dd>
												特价：<strong class="red">￥52.9</strong>
											</dd>
											<dd>
												<span class="startotal"></span>
											</dd>
											<dd>
												<a class="addcat" href="#">加入购物车</a>
											</dd>
										</dl></li>
								</ul>
							</div>
							<div class="f-l promotion">
								<h2>促销活动</h2>
								<p>指定冰洗买就送插座!液晶电视清仓大放价，小家电惠战十月，最低三大合资空调疯狂抢购</p>
							</div>
						</div>
						<!--hotbox end-->
				
						<div class="retrieve">
							<dl class="cf">
								<dt>品牌：</dt>
								<dd>
									<span><a href="#" class="current">全部</a></span><span><a
										href="#">泰滋泰味(1)</a></span><span><a href="#">金象(3)</a></span><span><a
										href="#">金蝶(6)</a></span><span><a href="#">红水晶(8)</a></span><span><a
										href="#">樱城(5)</a></span>
								</dd>
							</dl>
							<dl class="cf">
								<dt>包装：</dt>
								<dd>
									<span><a href="#" class="current">全部</a></span><span><a
										href="#">全部袋装(19)</a></span>
								</dd>
							</dl>
							<dl class="cf">
								<dt>产地：</dt>
								<dd>
									<span><a href="#" class="current">全部</a></span><span><a
										href="#">全部其他国家和地区(12)</a></span>
								</dd>
							</dl>
							<div class="clear"></div>
						</div>
						<!--retrieve end-->
				
						<div class="product">
							<div class="productsreach">
								<dl>
									<dt>显示：</dt>
									<dd>
										<a class="current" id="imgicon" href="#">图片</a><a id="listicon"
											href="#">列表</a>
									</dd>
								</dl>
								<dl style="margin: 0;">
									<dt>排列：</dt>
									<dd>
										<div id="rankmenu" class="">
											<a href="#">默认排序</a>
											<ul class="cf">
												<li><a href="#">价格高低</a></li>
												<li><a href="#">上架时间</a></li>
											</ul>
										</div>
										<div class="iconsreach">
											<a class="current" id="price" href="#">价格</a><a id="sales"
												href="#">销量</a><a id="discuss" href="#">评论</a>
										</div>
									</dd>
								</dl>
								<dl class="last">
									<dt>筛选：</dt>
									<dd>
										<input name="" id="cx" type="checkbox"><label for="cx">促销</label>
										<input name="" id="zp" type="checkbox"><label for="zp">有赠品</label>
										<input name="" id="xp" type="checkbox"><label for="xp">新品</label>
									</dd>
								</dl>
							</div>
						</div>
						<!--product end-->
				
						<script type="text/javascript">
							$(document).ready(function() {
								$("#rankmenu").hoverClass("current");
							});
						</script>
				
						<div class="productlist">
							<ul>
								<c:forEach items="${requestScope.goodsList }" var="goods" varStatus="stat">
									<li>
										<a href="${rootpath }/goods/${goods.id}.htm" target="_blank">
											<c:choose>
												<c:when test="${fn:startsWith(goods.listImgPath,'http')}">
													<img src="${goods.listImgPath }" alt="" height="160" width="170"></a>
												</c:when>
												<c:when test="${goods.listImgPath != null && goods.listImgPath != ''}">
													<img src="${websitePath }${goods.listImgPath }" alt="" height="160" width="170"></a>
												</c:when>
												<c:otherwise>
													<img src="${rootpath }/images/no_pic.jpg" alt="" height="160" width="170"></a>
												</c:otherwise>
											</c:choose>
										<dl>
											<dt>
												<a href="${rootpath }/goods/${goods.id}.htm" target="_blank">${goods.name }</a>
											</dt>
											<dd>
												市场价：<strong class="red" style="text-decoration: line-through;">￥${goods.marketPrice }</strong>
											</dd>
											<dd>
												特价：<strong class="red">￥${goods.price }</strong>
											</dd>
											<dd>
												<span class="startotal"></span>
											</dd>
											<dd>
												<a class="addcat" href="${rootpath }/shopCarInsertSubmit.htm?gid=${goods.id}" target="_blank">加入购物车</a>
											</dd>
										</dl>
									</li>
								</c:forEach>
							</ul>
						</div>
				
						<div class="clear"></div>
						
						<form action="${rootpath }/goods.htm">
							<div class="pagecon">
								<div class="f-r pagination">
									<!-- <span class="disabled">&lt; 上一页</span> -->
									<a href="${rootpath }/goods_${requestScope.pageInfoUtil.prePage}.htm">&lt; 上一页</a>
									<%-- 
										第一种情况:当前页:不能加链接
										第二种情况:总页数少于10; 列出1,2,3,4,5,6,(全部列出来)
										第三种情况:如果大于10:1 2 3 4 5 .... 20,21,22,23(共23页)
										
										if()
										{
											/* 总页数小于10 */
										 	for(int i = 1 ; i <= 10 ; i ++)
										 	{
												if( i == currentPage)
												{
													/* 直接显示 */
												}else
												{
													/* 加链接 */
												}
										 	}
										}else
										{
											/* 总页数大于10 */
											for(int i = 1 ; i < 5 ; i ++)
											{
												if( i == currentPage)
												{
													/* 直接显示 */
												}else
												{
													/* 加链接 */
												}
											}
											System.out.println("...")
											for(int i = totalPage - 5 ; i < totalPage - 1 ; i ++ )
											{
												if( i == currentPage)
												{
													/* 直接显示 */
												}else
												{
													/* 加链接 */
												}
											}
										}
									 --%>
									<c:choose>
										<c:when test="${requestScope.pageInfoUtil.totalPage <= 1}">
											<span class="current">1</span>
										</c:when>
										<c:when test="${requestScope.pageInfoUtil.totalPage >= 1 && requestScope.pageInfoUtil.totalPage <= 10 }">
											<c:forEach begin="1" end="${requestScope.pageInfoUtil.totalPage - 1}" step="1" var="pVar">
												<%-- 当前页,不加链接, --%>
												<c:choose>
													<c:when test="${requestScope.pageInfoUtil.currentPage == pVar}">
														<span class="current">${pVar }</span>
													</c:when>
													<c:otherwise>
														<a href="${rootpath }/goods_${pVar}.htm">${pVar}</a>
													</c:otherwise>
												</c:choose>
											</c:forEach>
										</c:when>
										<c:otherwise>
											<!-- 1 2 3 4 5 -->
											<c:forEach begin="1" end="5" step="1" var="pVar">
												<%-- 当前页,不加链接, --%>
												<c:choose>
													<c:when test="${requestScope.pageInfoUtil.currentPage == pVar}">
														<span class="current">${pVar }</span>
													</c:when>
													<c:otherwise>
														<a href="${rootpath }/goods_${pVar}.htm">${pVar}</a>
													</c:otherwise>
												</c:choose>
											</c:forEach>
											<span class="dian3">&nbsp;&nbsp;&nbsp;....&nbsp;&nbsp;&nbsp;</span>
											<c:forEach begin="${requestScope.pageInfoUtil.totalPage - 4 }" end="${requestScope.pageInfoUtil.totalPage - 1 }" step="1" var="pVar">
												<%-- 当前页,不加链接, --%>
												<c:choose>
													<c:when test="${requestScope.pageInfoUtil.currentPage == pVar}">
														<span class="current">${pVar }</span>
													</c:when>
													<c:otherwise>
														<a href="${rootpath }/goods_${pVar}.htm">${pVar}</a>
													</c:otherwise>
												</c:choose>
											</c:forEach>
										</c:otherwise>
									</c:choose>
									<a href="${rootpath }/goods_${requestScope.pageInfoUtil.nextPage}.htm">下一页 &gt; </a>
									<div class="yepage">
										到第
										<input class="stext" name="currentPage" id="" value="1" type="text">页
										<input class="btnimg" name="" id="" value="" type="submit">
									</div>
								</div>
								<!--pagination end-->
							</div>
					
						</form>
					</div>
					<!--rightlist end-->
				
					<div class="clear"></div>
				</div>
			</div>
			<%@ include file="/common/include/footer.jsp"%>
		</div>
	</body>
</html>